#include <stdio.h>
#include <stdlib.h>

#include <unistd.h>/*for environ*/
extern char** environ;
#define SET_HIGHTLIGHT_RED printf("\033[32m");
#define SET_ZERO printf("\033[0m");

int main(int argc, char* argv[],char* env[]){
    SET_HIGHTLIGHT_RED; 
    printf("main args\n");
    SET_ZERO;
    for(int i = 0; env[i]; ++i){
        printf("%s\n",env[i]);
    }
    SET_HIGHTLIGHT_RED; 
    puts("\n\ngetenv");
    SET_ZERO;

    // stdlib.h 具体 通过man来查
    char* path = getenv("PATH");
    printf("PATH:  %s\n", path);
    
    SET_HIGHTLIGHT_RED; 
    puts("\n\nenviron char**");
    SET_ZERO;
    for(int i = 0; environ[i]; ++i){
        printf("%s\n",environ[i]);
    }
    
    SET_ZERO;
    return 0;
}

